﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    /*
        var friday = DateTime.Now.GetThisFriday();
     */
    //TODO:Convert to using an enum of the days of week also do the same for the last Thursday etc
    public static partial class DateTimeExtensions
    {
        public static DateTime GetThisFriday(this DateTime dt)
        {
            var today = DateTime.Now;
            return new GregorianCalendar().AddDays(today, -((int)today.DayOfWeek) + 5);
        }

    }
}
